<%@ page language="java" contentType="text/html;charset=UTF-8"
   	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<script>
	function trim(stringToTrim) {
		return stringToTrim.replace(/^\s+|\s+$/g,"");
	}
	function ltrim(stringToTrim) {
		return stringToTrim.replace(/^\s+/,"");
	}
	function rtrim(stringToTrim) {
		return stringToTrim.replace(/\s+$/,"");
	}
	function Validate(){
		var title=document.getElementById("txttitle").value;
		if(trim(title)==""){
			alert("Please enter title");
			document.getElementById("txttitle").focus();
			return false;
		}
		return true;
	}
</script>
<table cellpadding="0" cellspacing="0" width="600" align="center" border="0" style="color: #333;">
<c:forEach var="x" begin="0" end="${fn:length(data)-1}" step="1" varStatus ="status">
	<tr align="center"><td colspan="2" style="font-size:13px;" height="30"><u>ព័ត៌មានលំអិតអំពីឯកសារ</u></td></tr>
	<tr><td colspan="2"><input name="txtid" type="hidden" value="${data[x].FILE_ID}"/></td></tr>
	<tr>
		<td width="120" height="30" align="right" class="mylabel">ឈ្មោះឯកសារ :&nbsp;</td>	
		<td width="" align="left"><a href="${weburl}${data[x].FILE_PATH}${data[x].FILE_NAME}">${data[x].FILE_NAME}</a></td>
	</tr>
	<tr>
		<td  width="120" height="30" align="right" valign="middle" class="mylabel">ចំណងជើង :&nbsp;</td>	
		<td  align="left"​ valign="middle"><c:out value="${data[x].FILE_TITLE}"></c:out> </td>
	</tr>
	<tr height="30">
		<td align="right" class="mylabel">ប្រភេទ :&nbsp;</td>	
		<td align="left"><c:out value="${data[x].CATEGORY_NAME}"></c:out></td>
	</tr>
	
	<tr><td colspan="2" height="5"> </td></tr>
	
	<c:if test="${fn:length(data[x].FILE_DESC)>0}">
		<tr height="30">
			<td align="right" valign="middle" class="mylabel">បរិយាយ :&nbsp;</td>	
			<td align="left" valign="middle" ><c:out value="${data[x].FILE_DESC}"></c:out></td>
		</tr>
	</c:if>

	<tr height="30">
		<td align="right" class="mylabel">Upload​ ដោយ :&nbsp;</td>	
		<td align="left"><c:out value="${data[x].USER_NAME}"></c:out></td>
	</tr>
		
	<tr><td colspan="2" height="8"> </td></tr>
	
	<c:if test="${fn:length(userlist)>0}">
	<tr height="30">
		<td align="right" valign="middle" class="mylabel">គណនីចែករំលែក :&nbsp;</td>	
		<td align="left" valign="middle">
			<c:forEach var="i" begin="0" end="${fn:length(userlist)-1}" step="1" varStatus ="status">
				<c:out value="${userlist[i].USER_NAME}"></c:out>
				<c:if test="${i<fn:length(userlist)-1}">
					<c:out value=","></c:out>
				</c:if>
			</c:forEach>
		</td>
	</tr>
	<tr><td colspan="2" height="5"> </td></tr>
	</c:if>
	
	<c:if test="${fn:length(grouplist)>0}">
	<tr height="30">
		<td align="right" valign="middle" class="mylabel">ក្រុមចែករំលែក :&nbsp;</td>	
		<td align="left" valign="middle">
			<c:forEach var="j" begin="0" end="${fn:length(grouplist)-1}" step="1" varStatus ="status">
				<c:out value="${grouplist[j].GROUP_NAME}"></c:out>
				<c:if test="${j<fn:length(grouplist)-1}">
					<c:out value=","></c:out>
				</c:if>
			</c:forEach>
		</td>
	</tr>
	<tr><td colspan="2" height="5"> </td></tr>
	</c:if>
	
	<tr>
		<td colspan="2" align="center" height="30"><a href="view_all_files.html">ត្រលប់ទៅទំព័រឯកសារចែករំលែក</a></td>
	</tr>
	<tr><td colspan="2" height="25">&nbsp;</td></tr>
</c:forEach>
</table>
